package com.example.qxfw.ybzz.service.impl;

import com.example.qxfw.common.entity.qx.ThirtyYearDayStatics;
import com.example.qxfw.ybzz.mapper.ThirtyYearDayStaticsMapper;
import com.example.qxfw.ybzz.service.ThirtyYearDayStaticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class ThirtyYearDayStaticsServiceImpl implements ThirtyYearDayStaticsService {

    @Autowired
    private ThirtyYearDayStaticsMapper thirtyYearDayStaticsMapper;

    @Override
    public String getRain(String stationId, String startDays, String endDays) {
       String sumRain = thirtyYearDayStaticsMapper.selectRain(stationId, Integer.parseInt(startDays), Integer.parseInt(endDays));
        return sumRain;
    }

    @Override
    public String getRain1(String stationId, String startDays, String endDays) {
        String sumRain = thirtyYearDayStaticsMapper.selectRain2(stationId, Integer.parseInt(startDays), Integer.parseInt(endDays));
        return sumRain;
    }

    @Override
    public String getAvgTemp3(String stationId, String startDays, String endDays) {
        String avgTemp = thirtyYearDayStaticsMapper.selectAvgTemp3(stationId, Integer.parseInt(startDays), Integer.parseInt(endDays));
        return avgTemp;
    }

    @Override
    public String getAvgTemp4(String stationId, String startDays, String endDays) {
        String avgTemp = thirtyYearDayStaticsMapper.selectAvgTemp4(stationId, Integer.parseInt(startDays), Integer.parseInt(endDays));
        return avgTemp;
    }

    @Override
    public String getMaxTemp3(String stationId, String startDays, String endDays) {
        String maxTemp = thirtyYearDayStaticsMapper.selectMaxTemp3(stationId, Integer.parseInt(startDays), Integer.parseInt(endDays));
        return maxTemp;
    }

    @Override
    public String
    getMaxTemp4(String stationId, String startDays, String endDays) {
        String maxTemp = thirtyYearDayStaticsMapper.selectMaxTemp4(stationId, Integer.parseInt(startDays), Integer.parseInt(endDays));
        return maxTemp;
    }

    @Override
    public String getMinTemp3(String stationId, String startDays, String endDays) {
        String minTemp = thirtyYearDayStaticsMapper.selectMinTemp3(stationId, Integer.parseInt(startDays), Integer.parseInt(endDays));
        return minTemp;
    }

    @Override
    public String getMinTemp4(String stationId, String startDays, String endDays) {
        String minTemp = thirtyYearDayStaticsMapper.selectMinTemp4(stationId, Integer.parseInt(startDays), Integer.parseInt(endDays));
        return minTemp;
    }


    @Override
    public String getAvgTemp1(String time1, String time2, String stationId) {
        return thirtyYearDayStaticsMapper.selectAvgTemp1(time1, time2, stationId);
    }

    @Override
    public String getAvgWindVelocity(String time1, String time2, String stationId) {
        return thirtyYearDayStaticsMapper.selectAvgWindVelocity(time1, time2, stationId);
    }

    @Override
    public String getMaxTemp1(String time1, String time2, String stationId) {
        return thirtyYearDayStaticsMapper.selectMaxTemp1(time1,time2,stationId);
    }

    @Override
    public String getMinTemp1(String time1, String time2, String stationId) {
        return thirtyYearDayStaticsMapper.selectMinTemp1(time1, time2, stationId);
    }

    @Override
    public String getAvgRain1(String time1, String time2, String stationId) {
        return thirtyYearDayStaticsMapper.selectAvgRain1(time1, time2, stationId);
    }

    @Override
    public String getAvgRain2(int day1, int day2, String stationId) {
        return thirtyYearDayStaticsMapper.selectAvgRain2(day1, day2, stationId);
    }

    @Override
    public String getAvgRain3(int day1, int day2, String stationId) {
        return thirtyYearDayStaticsMapper.selectAvgRain3(day1, day2, stationId);
    }

    @Override
    public String getMaxRain(int day1, int day2, String stationId) {
        return thirtyYearDayStaticsMapper.selectMaxRain(day1, day2, stationId);
    }

    @Override
    public String getMaxRain1(int day1, int day2, String stationId) {
        return thirtyYearDayStaticsMapper.selectMaxRain1(day1, day2, stationId);
    }

    @Override
    public String getAvgWindV(String time1, String time2, String stationId) {
        return thirtyYearDayStaticsMapper.selectAvgWindV(time1,time2,stationId);
    }

    @Override
    public List<String> getSumHour(String time1, String time2, String stationId) {
        return thirtyYearDayStaticsMapper.selectSumHour(time1, time2, stationId);
    }

    @Override
    public List<ThirtyYearDayStatics> getMaxMinTemp(String date, String stationId) {
        return thirtyYearDayStaticsMapper.selectMaxTempMinTemp(date,stationId);
    }

    @Override
    public List<String> getRain1(String date, String stationId) {
        return thirtyYearDayStaticsMapper.selectRain1(date,stationId);
    }

    @Override
    public List<ThirtyYearDayStatics> getList(int day1, int day2, String stationId) {
        return thirtyYearDayStaticsMapper.selectList(day1, day2, stationId);
    }

    @Override
    public List<ThirtyYearDayStatics> getList1(int day1, int day2, String stationId) {
        return thirtyYearDayStaticsMapper.selectList1(day1, day2, stationId);
    }

    @Override
    public List<ThirtyYearDayStatics> getList2(int day1, int day2, String stationId) {
        return thirtyYearDayStaticsMapper.selectList2(day1, day2, stationId);
    }
}
